require 'json'

class PaymentController < ApplicationController
  include PaymentHelper
  
  def init
    @product = Product.find(params[:productid])
    @user = userContext.user    
    @order_id = newOrderId
    userContext.add('orderId', @order_id)    
    userContext.add(@order_id, @product.id)
  end
  
  def submit
    @user = userContext.user
    s_token = params[:s_token]
    cc_masked = params[:cc_masked]
    order_id = params[:order_id]    
    @res = make_purchase(userContext, order_id, s_token, cc_masked)            
  end
  
end
